package cll;

public class Place {
	private double CXCL13 = 0;
	private double angleGradient13 = (Math.random()-0.5) *2*Math.PI; 
	private double valeurGradient13 = 0;
	private double gradx13 = 0;
	private double grady13 = 0;
	
	private double CXCL12 = 0;
	private double angleGradient12 = (Math.random()-0.5) *2*Math.PI; 
	private double valeurGradient12 = 0;
	private double gradx12 = 0;
	private double grady12 = 0;
	
	private double CCL19 = 0;
	private double angleGradient19 = (Math.random()-0.5) *2*Math.PI; 
	private double valeurGradient19 = 0;
	private double gradx19 = 0;
	private double grady19 = 0;
	
	public Place(double Cxcl13,double Cxcl12,double ccl19) {CXCL13 = Cxcl13;	CXCL12 = Cxcl12;CCL19 = ccl19;}
	
	public double quantityChemokine13(){return CXCL13;}
	public double quantityChemokine12(){return CXCL12;}
	public double quantityChemokine19(){return CXCL12;}
	
	public void setGradient13(double gradx, double grady) {
		this.gradx13=gradx;
		this.grady13=grady;
		this.valeurGradient13 = gradx*gradx+grady*grady;
		// si le gradient n'est pas defini, c'est un angle aleatoire
		if ((gradx == 0) & (grady==0)){
			this.angleGradient13 = (Math.random()-0.5) *2*Math.PI;
		}
		else{
			this.angleGradient13 = Math.atan2(grady,gradx);
		}
		
		
		
	}
	public void setGradient12(double gradx, double grady) {
		this.gradx12=gradx;
		this.grady12=grady;
		this.valeurGradient12 = gradx*gradx+grady*grady;
		// si le gradient n'est pas defini, c'est un angle aleatoire
		if ((gradx == 0) & (grady==0)){
			this.angleGradient12 = (Math.random()-0.5) *2*Math.PI;
		}
		else{
			this.angleGradient12 = Math.atan2(grady,gradx);
		}	
	}
	
	public void setGradient19(double gradx, double grady) {
		this.gradx19=gradx;
		this.grady19=grady;
		this.valeurGradient19 = gradx*gradx+grady*grady;
		// si le gradient n'est pas defini, c'est un angle aleatoire
		if ((gradx == 0) & (grady==0)){
			this.angleGradient19 = (Math.random()-0.5) *2*Math.PI;
		}
		else{
			this.angleGradient19 = Math.atan2(grady,gradx);
		}
	}
	
	public double getDirection13(){return angleGradient13;}
	public double getGradx13(){return gradx13;}
	public double getGrady13(){return grady13;}
	public double getGradient13() {return angleGradient13;}
	public double getChemokine13() {return CXCL13;}
	public double getValeur13(){return Math.sqrt(gradx13*gradx13 +grady13*grady13);}
	public void addChemokine13(double d) {CXCL13+=d;}
	public void setChemokine13(double d) {CXCL13=d;}
	
	
	public double getDirection12(){return angleGradient12;}
	public double getGradx12(){return gradx12;}
	public double getGrady12(){return grady12;}
	public double getGradient12() {return angleGradient12;}
	public double getChemokine12() {return CXCL12;}
	public double getValeur12(){return Math.sqrt(gradx12*gradx12 +grady12*grady12);}
	public void addChemokine12(double d) {CXCL12+=d;}
	public void setChemokine12(double d) {CXCL12=d;}
	
	public double getDirection19(){return angleGradient19;}
	public double getGradx19(){return gradx19;}
	public double getGrady19(){return grady19;}
	public double getGradient19() {return angleGradient19;}
	public double getChemokine19() {return CCL19;}
	public double getValeur19(){return Math.sqrt(gradx19*gradx19 +grady19*grady19);}
	public void addChemokine19(double d) {CCL19+=d;}
	public void setChemokine19(double d) {CCL19=d;}
	
}
